import { createRouter, createWebHistory } from 'vue-router'
import { useAccountStore } from "@/store";
const routes = [
  {
    path: '/mybox',
    name: 'mybox',
    component: () => import('../views/Mybox.vue')
  },
  {
    path: '/joinbox',
    name: 'joinbox',
    component: () => import('../views/Joinbox.vue')
  },
  {
    path: '/person',
    name: 'person',
    component: () => import('../views/Person.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search.vue')
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('../views/Message.vue')
  },
  {
    path: '/question',
    name: 'question',
    component: () => import('../views/Question.vue'),
    props: true
  },
  {
    path: '/comment',
    name: 'comment',
    component: () => import('../views/Comment.vue'),
    props: true
  },
  {
    path: '/',
    name: 'welcome',
    component: () => import('@/views/WelcomeView.vue'),
    children: [
      {
        path: '',
        name: 'welcome-login',
        component: () => import('@/components/welcome/LoginPage.vue')
      }, {
        path: 'register',
        name: 'welcome-register',
        component: () => import('@/components/welcome/RegisterPage.vue')
      }, {
        path: 'forget',
        name: 'welcome-forget',
        component: () => import('@/components/welcome/ForgetPage.vue')
      }
    ]
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.VUE_APP_BASE_URL),
  routes
})

export default router
